package cn.wolfcode.crm.service.impl;

import cn.wolfcode.crm.domain.PurchaseOrderItem;
import cn.wolfcode.crm.mapper.PurchaseOrderItemMapper;
import cn.wolfcode.crm.query.PageResult;
import cn.wolfcode.crm.query.QueryObject;
import cn.wolfcode.crm.service.IPurchaseOrderItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PurchaseOrderItemServiceImpl implements IPurchaseOrderItemService {

    @Autowired
    private PurchaseOrderItemMapper mapper;

    public List<PurchaseOrderItem> list() {
        return mapper.selectAll();
    }

    public PageResult query(QueryObject qo) {
        int total = mapper.queryForCount(qo);
        List<PurchaseOrderItem> rows = mapper.queryForList(qo);
        return new PageResult(total,rows);
    }

}
